import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'main',
    component: () => import('../views/Main.vue'),
    children: [
      {
        path: 'my',
        name: 'my',
        component: () => import('../views/My.vue'),
      },
      {
        path: 'home',
        name: 'home',
        alias: '',
        component: () => import('../views/Home.vue'),
      },
      {
        path: 'menu',
        name: 'Menu',
        component: () => import('../views/Menu.vue'),
      },
      {
        path: 'bookshelf',
        name: 'bookshelf',
        component: () => import('../views/Bookshelf.vue'),
      },
    ]
  },
  {
    path: '/noveldetail/:pid',
    name: 'noveldetail',
    component: () => import('../views/Noveldetail.vue')
  },
  {
    path: '/catalogue/:pid',
    name: 'catalogue',
    component: () => import('../views/Catalogue.vue')
  },
  {
    path: '/bookcontent/:secId/:bookId',
    name: 'bookcontent',
    component: () => import('../views/BookContent.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/login.vue'),
  },
  {
    path: '/classifylist',
    name: 'classifylist',
    component: () => import('../views/ClassifyList.vue'),
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../views/Search.vue'),
  },
]

const router = new VueRouter({
  routes
})

export default router
